import request from '@/utils/request';

// import {exportMethod} from '@/utils/utils'
import * as proxy from '@/constants/proxy';
import { exportMethod } from '@/utils/utils';

//技术标准
// 列表数据 
export function getList(params: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/list',
    method: 'get',
    params
  })
}
//获取详情
export function getDetail(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/tresult/contribute/standard/getDetailById?id=` + id,
    method: 'post',
  })
}
//解锁
export function getUnlock(data: any) {
  return request({
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/unlock/' + data,
      method: 'get',
  })
}
//锁定
export function getLock(data: any) {
  return request({
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/lock/' + data,
      method: 'get',
  })
}
//导出
export function getExport(data: any) {
  const params = {
    method:'post',
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/export',
    data,
    fileName: '技术标准表格',
  }
  return exportMethod(params)
}
//批量删除
export function getDelect(id:any) {
  return request({
    method: 'delete',
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/delete/' + id,
  })
}
//新增基础信息
export function getAdd(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/add',
    method: 'post',
    data
  })
}
//修改数据
export function getUpdate(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/contribute/standard/update',
    method: 'post',
    data
  })
}
//确认
export function getConfirm(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/tresult/contribute/standard/confirm`,
    method: 'post',
    data
  })
}
//新增文件
export function addFiles(data: any) {
  return request({
    url: '/kjsl/tresult/contribute/standard/addFile',
    method: 'post',
    data
  })
}
// 获取机构树
export const getOrgTree = () => {
  return request({
    url: proxy.CHECC_API_CMS + '/org/tree',
    method: 'get'
  })
}

///--------技术标准项目
// 列表数据 
export function getListkproject(params: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/list',
    method: 'post',
    params
  })
}
//获取详情
export function getDetailkproject(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/tresult/kproject/standard/getDetailById?id=` + id,
    method: 'post',
  })
}
//解锁
export function getUnlockkproject(data: any) {
  return request({
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/unlock/' + data,
      method: 'get',
  })
}
//锁定
export function getLockkproject(data: any) {
  return request({
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/lock/' + data,
      method: 'get',
  })
}
//导出
export function getExportkproject(data: any) {
  const params = {
    method:'post',
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/export',
    data,
    fileName: '技术标准项目',
  }
  return exportMethod(params)
}
//批量删除
export function getDelectkproject(id:any) {
  return request({
    method: 'delete',
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/delete/' + id,
  })
}
//新增基础信息
export function getAddkproject(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/add',
    method: 'post',
    data
  })
}
//修改数据
export function getUpdatekproject(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/tresult/kproject/standard/update',
    method: 'post',
    data
  })
}
//确认
export function getConfirmkproject(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/tresult/kproject/standard/confirm`,
    method: 'post',
    data
  })
}
//新增文件
export function addFileskproject(data: any) {
  return request({
    url: '/kjsl/tresult/kproject/standard/addFile',
    method: 'post',
    data
  })
}






